<template>
  <div class="divLogin">
    <div class="divContent">
      <div class="divLeft">
        <div class="divTitle">
          <img src="http://www-wms-java.itheima.net/img/title.ef005a7a.png" />
        </div>
        <el-form>
          <el-form-item>
            <div class="divUser">
              <div class="divImg">
                <img
                  data-v-2d7b3bde=""
                  src=""
                />
              </div>
              <div class="divInput"><el-input v-model="form.username" /></div>
            </div>
          </el-form-item>
          <el-form-item>
            <div class="divPwd">
              <div class="divImg">
                <img
                  data-v-2d7b3bde=""
                  src=""
                />
              </div>
              <div class="divInput">
                <el-input
                  v-model="form.password"
                  :type="type"
                >
                <i
                  class="el-icon-view"
                  slot="suffix"
                  @click="changeType"
                  style="cursor: pointer"
                />
                </el-input>
              </div>
            </div>
          </el-form-item>
        </el-form>
        <div class="divCheckBox">
          <el-checkbox v-model="checked">记住密码</el-checkbox>
        </div>
        <div class="divBtnLogin">
          <el-button @click="$router.push('/home')">立即登录</el-button>
        </div>
      </div>
      <div class="divRight" />
    </div>
  </div>
</template>

<script>
export default {
  name: 'login-page',
  data () {
    return {
      form: {
        username: 'admin',
        password: '123456'
      },
      checked: false,
      type: 'password'
    }
  },
  methods: {
    changeType () {
      if (this.type === 'text') {
        this.type = 'password'
      } else {
        this.type = 'text'
      }
    }
  }
}
</script>

<style lang="scss" scoped>
html,
body {
  width: 100%;
  height: 100%;
}
.divLogin {
  background: #fdfafa;
  .divContent {
    width: 958px;
    height: 516px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgb(93 93 93 / 33%);
    background-color: #fff;
    border-radius: 40px;
    .divLeft {
      float: left;
      width: 398px;
      height: 516px;
      background: #fff;
      border-radius: 34px 0 0 34px;
      margin: 0 auto;
      .el-input__inner {
        width: 230px;
        height: 50px;
        background-color: #f8f5f5;
        border-bottom-left-radius: 0;
        border-top-left-radius: 0;
      }
      .divTitle {
        margin-left: 124px;
        margin-top: 72px;
        img {
          width: 150px;
          height: 64px;
        }
      }
      .el-form-item__error {
        margin-left: 110px;
      }
      .divPwd,
      .divUser {
        margin-left: 59px;
        width: 280px;
        height: 50px;
        .divImg {
          float: left;
          width: 50px;
          height: 50px;
          background: #eae7e7;
          border-radius: 8px 0 0 8px;
        }
        .divInput {
          float: left;
         ::v-deep .el-input__suffix {
          top: 5px;
          right: 7px;
         }
        }
      }

      .divUser {
        margin-top: 50px;
        img {
          width: 25px;
          height: 24px;
          margin: 12px 13px;
        }
      }
      .divPwd {
        margin-top: 22px;
        img {
          width: 24px;
          height: 24px;
          margin: 13px;
        }
      }
      .divCheckBox {
        margin-top: 22px;
        margin-left: 60px;
      }
      .divBtnLogin {
        margin-top: 23px;
        margin-left: 59px;
        .el-button {
          width: 280px;
          height: 50px;
          background: #ffb200;
          border-radius: 8px;
          box-shadow: 0 2px 9px 1px rgba(255, 178, 0, 0.47);
          font-size: 16px;
          font-weight: 600;
          text-align: center;
          color: #332929;
          line-height: 22px;
        }
      }
      ::v-deep .el-input__inner {
        width: 230px;
        height: 50px;
        background-color: #f8f5f5;
        border-bottom-left-radius: 0;
        border-top-left-radius: 0;
      }
    }
    .divRight {
      float: right;
      background-image: url(http://www-wms-java.itheima.net/img/contentBg.1321d126.png);
      background-position: 50%;
      background-repeat: no-repeat;
      background-size: cover;
      width: 560px;
      height: 516px;
    }
  }
  ::v-deep .el-checkbox__input {
    &.is-checked {
      & + .el-checkbox__label {
        color: #ffb200;
      }
      .el-checkbox__inner {
        background-color: #ffb200;
        border-color: #ffb200;
      }
    }
    .el-checkbox__inner:hover {
      border-color: #ffb200;
    }
  }
}
</style>
